(function (win) {
    var doc = win.document, html = doc.documentElement, option = html.getAttribute("use-rem");
    if(/Android [4-6]/.test(navigator.appVersion)) {
	     window.addEventListener("resize", function() {
	         if(document.activeElement.tagName=="INPUT" || document.activeElement.tagName=="TEXTAREA") {
	             window.setTimeout(function() {
	                 document.activeElement.scrollIntoViewIfNeeded();
	             },0);
	         }
	     })
	}
    if (option === null) {
        return
    }
    var baseWidth = parseInt(option).toString() === "NaN" ? 640 : parseInt(option);
    var grids = baseWidth / 100;
    var clientWidth = html.clientWidth || 320;
    html.style.fontSize = clientWidth / grids + "px";
    var testDomWidth = 0;
    var adjustRatio = 0;
   
    var reCalc = function () {
        var newCW = html.clientWidth;
        if (newCW === clientWidth) {
            return
        }
        clientWidth = newCW;
        html.style.fontSize = newCW * (adjustRatio ? adjustRatio : 1) / grids + "px"
    };
    if (!doc.addEventListener) {
        return
    }
    var resizeEvt = "orientationchange" in win ? "orientationchange" : "resize";
    win.addEventListener(resizeEvt, reCalc, false);
    doc.addEventListener("DOMContentLoaded", reCalc, false)
})(window);
//弹窗定时器
function tc_open(msg){
	if($("#tc_btn").length<1){
		var s = '<div class="tc_btn" id="tc_btn"><strong>'+msg+'</strong></div>';
		$(document.body).append(s);
	}
	/*console.log($("#tc_btn"));
	$('#tc_btn').remove();
	console.log($("#tc_btn"));return;*/
	setTimeout(function(){
		if($("#tc_btn").length>0){
			$("#tc_btn").remove();
		}
	},2000);
}
function toOrderDetail(orderIds){
	window.location.href=server_url+"buyerOrder/detail.do?orderid="+orderIds;
}